package com.itheima.service.impl;

import com.itheima.dao.BlogSortMapper;
import com.itheima.pojo.BlogSort;
import com.itheima.pojo.BlogSort;
import com.itheima.service.BlogSortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Description:
 *
 * @author WangChang
 * @date 2020/8/4 9:40
 */
@Service
public class BlogSortServiceImpl implements BlogSortService {

    @Autowired
    private BlogSortMapper blogSortMapper;
    @Override
    public void add(BlogSort tBlogSort) {
        blogSortMapper.insert(tBlogSort);
    }

    @Override
    public void delet(List<BlogSort> list) {
        for (BlogSort tBlogSort : list) {
            blogSortMapper.delete(tBlogSort);
        }
    }

    @Override
    public void blogSortByClickCount() {
        blogSortMapper.blogSortByClickCount();
    }

    @Override
    public List<BlogSort> findAll() {
        return blogSortMapper.selectAll();
    }

    @Override
    public List<BlogSort> selectSort() {
        return blogSortMapper.selectAll();
    }
}
